<script type='text/javascript' src='/static/pmp/js/pinger.js'></script>
<!-- continued from parent webpages, e.g. tcAnalysis.html-->
    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container-fluid">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          
          <img src="/static/pmp/img/title_icon.png" class="brand" style="padding-right: 2px"/><a class="brand" style="padding-top: 10px" href="/pmp/">&nbsp;CBE BPE Toolkit</a>
          <div class="nav-collapse">
            <ul class="nav" style="padding-top: 1px">
              <li><a href="/pmp/">Home</a></li>
              <li><a href="/static/doc/_build/html/">Documentation</a></li>
            </ul>
            	<span class="navbar-text" id="headerProject">
            		Project:
            		{{ projectF.management_form }}
	       			{{ projectF.name }}
            	</span>
            <p class="navbar-text pull-right">	       		        	
	          {% if user.is_active %}
	          Welcome, {{user.username}}.  <a href="/admin/logout" style="color: white">log out</a>
	          {% else %} 
	            {% if user %}
	            Anonymous user. <a href="?login=" style="color: white">log in</a>
	            {% endif %}
	          {% endif %}
          	</p>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span2">
   		<div class="well sidebar-nav">
           	<ul class="nav nav-list">
           	  <li class="nav-header" id="setupHeader">Setup</li>
           	  <li id="home"><a href="/pmp/home">Home</a></li>
           	  <li id="weather"><a href="/pmp/weather/">Weather</a></li>
              <li id="pmpsetup"><a href="http://192.168.2.30/pmpsetup/">sMAP Source</a></li>
              {% if user.is_superuser %}
              <li id="admin"><a href="/admin/" target="_blank">Django Admin</a></li>
              {% endif %}
              <li class="nav-header">Project Information</li>
              <li id="building"><a href="/pmp/building">Building</a></li>
              <li id="maps"><a href="/pmp/maps">Maps</a></li>
              <li id="zones"><a href="/pmp/zones/">Zones</a></li>
              <li id="sensors"><a href="/pmp/sensors/">Sensors</a></li>
              <li id="deviceInstance"><a href="/pmp/deviceInstance/">Devices</a></li>
              <li class="nav-header">Analysis</li>
              <li id="trending"><a href="/pmp/trending/">Trending</a></li>
              <!--<li><a href="#">Energy</a></li>
              <li><a href="#">Water</a></li>-->
              <li id="comfort"><a href="/pmp/comfort/">Thermal Comfort</a></li>
              <li id="lighting"><a href="/pmp/lighting/">Lighting</a></li>
              <li id='acoustics'><a href="/pmp/acoustics/">Acoustics</a></li>
              <li id='iaq'><a href="/pmp/iaq/">IAQ</a></li>
              <li id='energy'><a href="/pmp/energy/">Energy</a></li>
              <li class="nav-header">Reporting</li>
              <li id="scsetup"><a href="/pmp/scsetup/">Setup</a></li>
              <li id="scorecard"><a href="/pmp/scorecard/">Scorecard</a></li>
              <li id="report"><a href="/pmp/report/">Report</a></li>
            </ul>    
          </div><!--/.well -->
        </div><!--/span-->

<script type='text/javascript'>
	//when the session is first established, check whether or not you can reach the dustbox--if not, hide the link and don't try to show it again until the next session
	if (typeof sessvars.sessionObj.smapUp == 'undefined'){
		pingThis.init("http://192.168.2.30/pmpsetup/title_icon.png")
		setTimeout("sessvars.sessionObj.smapUp = pingThis.smapUp", 1000)
		setTimeout("enableLink()", 1000)
	}
	else{
		enableLink();
	}
	function enableLink(){
		if (sessvars.sessionObj.smapUp){
			$('#pmpsetup').show()
		}
		else{
			var is_admin = '{{ user.is_superuser }}'
			$('#pmpsetup').hide()
		}
	}
</script>